home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_300 / 388_01 / ae / 91 / winner / ant.hin < prev   
Encoding:
Text File  |  1993-05-19  |  4.2 KB  |  114 lines

  1. Best Utility: <ant@mks.com> Anthony C Howe
  2.  
  3.     Anthony C Howe
  4.     Mortice Kern Systems Inc.    #CL-23
  5.     35 King St. N            268 Phillip St.
  6.     Waterloo, On            Waterloo, On        
  7.     Canada, N2J 2W9            Canada, N2L 6G9
  8.  
  9.  
  10. Judges' comments:
  11.  
  12.     Compile and run with a filename (writable or to be created) as an argument.
  13.     
  14.     For example, try:
  15.  
  16.     cp ant.hint hill
  17.     ant hill
  18.  
  19.     Note that some old BSD systems may have trouble compiling this entry.
  20.     They may complain about 'idlok' being undefined.  You can fix this
  21.     by changing line 26 from:
  22.  
  23.     2;initscr();d=LINES;raw();noecho();idlok(stdscr,1);if(0<(i= ...
  24.     to:
  25.     2;initscr();d=LINES;raw();noecho();if(0<(i= ...
  26.      
  27.     ***or*** update to a modern version of Un*x.  :-)  If you have source,
  28.     you can use this entry to help in your upgrade.
  29.  
  30.     You may need to change the makefile depending on what type of system
  31.     you are running.  See the notes in ansi.mk or common.mk.
  32.  
  33.     The author was kind enough to supply a list of references below,
  34.     in case you are still confused after read the source!  :-)
  35.  
  36.  
  37. Selected notes from the author:
  38.  
  39.     Ant's Editor vIOCCC91
  40.  
  41.     Text files consists of lines of printable text or tab characters.  
  42.     A line can be of arbitrary length and is delimited by either a 
  43.     newline or the end of file.  Carriage return is mapped to newline 
  44.     on input and ignored on output.  Tab stops are every eight columns.
  45.     Non-printable characters may have unpredictable results depending
  46.     on the implementation of CURSES.
  47.     
  48.     COMMANDS
  49.     h j k l        left, down, up, right cursor movement
  50.     H J K L        word left, page down, page up, word right
  51.     [ ]        beginning and end of line
  52.     t b        top and bottom of file
  53.     i        enter insert mode, formfeed to quit
  54.     x        delete character under the cursor
  55.     W        write buffer to file
  56.     R        refresh the screen
  57.     Q        quit
  58.     
  59.     EXIT STATUS
  60.     0    success
  61.     2    missing edit filename
  62.     
  63.     The BUF size should be set at compile time to 32767.  This value
  64.     was used because the Sozobon C compiler for the Atari ST has 16 
  65.     bit ints and a limit on the size of arrays & structures of 32k.  
  66.     Also the WatCom C compiler for the PC also has 16 bits ints.  On 
  67.     machines that have 32 bit ints (most unix boxes), a larger value 
  68.     for BUF could be used.
  69.     
  70.     It is recommend that compact memory model be used on PC class
  71.     machines.  Small memory model may work too provided BUF is not
  72.     too large.
  73.     
  74.     The character constants '\b', '\f', '\n', '\r', '\t' are used 
  75.     in order to provide more portable code, since the compiler should
  76.     handle the translation of them into the native character set.
  77.     Note that '\f' (formfeed) was used to exit insert mode because
  78.     K&R C had no escape constant for the escape-key.
  79.     
  80.     My goals for this project were to learn and experiment with the 
  81.     Buffer Gap Scheme [Fin80][net90], write a useful and *portable* 
  82.     programme, and meet the requirements of the IOCCC.  I initially 
  83.     planned to have a mini CURSES built-in like the IOCCC Tetris entry 
  84.     from a previous year, however this was not as portable as using a
  85.     CURSES library with TERMINFO/TERMCAP support.  
  86.  
  87.     I plan to post followups such as unobfuscated versions and bugs
  88.     fixes to comp.editors.  Reposts of the editor.101, gap.doc, and
  89.     editor.102 can be found in the same group every so often.
  90.  
  91.     This entry will display a file with long lines, but has trouble
  92.     scrolling the screen with long lines.  Paging up and down should
  93.     work correctly, however.
  94.  
  95.     REFERENCES
  96.     [Fin80]    Craig A. Finseth, "Theory and Practice of Text Editors or 
  97.         A Cookbook For An EMACS", TM-165, MIT Lab. for Computer 
  98.         Science
  99.     
  100.     [KeP81]    Kernighan & Plauger, "Software Tools in Pascal", 
  101.         Addison-Wesley, 81, chapter 6
  102.     
  103.     [Mil86]    Eugene W. Myers & Webb Miller, "Row-replacement Algorithms
  104.         for Screen Editors", TR 86-19, Dept. of Computer Science, 
  105.         U. of Arizona
  106.     
  107.     [MyM86]    Eugene W. Myers & Webb Miller, "A simple row-replacement 
  108.         method", TR 86-28, Dept. of Computer Science, U. of Arizona
  109.     
  110.     [Mil87]    Webb Miller, "A Software Tools Sampler", Prentice Hall, 87
  111.         ISBN 0-13-822305-X, chapter 5
  112.     
  113.     [net90]    "Editor 101/102" articles from comp.editors
  114.